package test1;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

@Service
public class SimpleMovieLister {

	//Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'simpleMovieLister': Injection of resource fields failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [test1.MovieFinder] is defined: expected single matching bean but found 2: [jpaMovieFinder, ibatisMovieFinder]
	//@Autowired
	//@Qualifier("ibatisMovieFinder")
	@Resource(name="ibatisMovieFinder")
	private MovieFinder movieFinder;

	/*
	@Autowired
	public SimpleMovieLister(@Qualifier("ibatisMovieFinder") MovieFinder movieFinder) {
		this.movieFinder = movieFinder;
	}
	*/
	
	public String getData(String name) {
		return "Hi " + name + "! " + movieFinder.getData();
	}

	public MovieFinder getMovieFinder() {
		return movieFinder;
	}

	public void setMovieFinder(MovieFinder movieFinder) {
		this.movieFinder = movieFinder;
	}
}
